

<div class="form-horizontal" style=" padding:10px">
	<div class="form-group">
		<label class="col-sm-2 control-label">提现金额：</label>
		<div class="col-sm-8">
			<input type="text"  value="<{$user_info.money}>"   id="money" placeholder="输入提现金额" class="form-control">
		</div>
	</div>
	
	
 
	
	<div class="form-group">
		<label class="col-sm-2 control-label">帐号：</label>
		<div class="col-sm-8">
		    <{:form_select('account_type',array('微信'=>'微信','支付宝'=>'支付宝'),"",array('id'=>'account_type','class'=>'form-control','style'=>'width:30%;display:inline-block'))}>
			<input type="text" style="width:60%; display:inline-block"   id="account" placeholder="请输入微信或支付帐户" class="form-control">
		</div>
	</div>
	 
	 
	 <{:Widget('BoxSns/User/setPhone')}>
	<div class="form-group">
	<div class="col-sm-2"></div>
	<div class="col-sm-8">
		<button  type="button" class="btn-primary btn  border-radius-none btn-lg"   onclick="post(this)"  data-loading-text="提交中……">提现</button>
	</div>
</div>
</div>


<script type="text/javascript">
$(function(){
	$("#save_phone_btn").hide();
})
$(function() {
    $('#money').keyup(function(event) {
        var val = $(this).val();
        isNumber($('#money'),val)
    });
})
function isNumber(obj,num){
    if(isNaN(num)){
        num = parseFloat(num);
        var str = /^NaN$/;
        if(str.test(num)){
            obj.val('');  
        }else{
            obj.val(num); 
        }
    }
}

function post(_this){
	var tel=$("#txtBindPhone").val();
	var money=parseFloat($("#money").val());
	if(money<50 || $("#money").val()==""){
		dialog('最少提现50元');
		return false;
	}
	$(_this).attr("onclick","javascript:");
	$(_this).text($(this).attr("data-loading-text"));
	var code=$("#txtPhoneCode").val();
	var account=$("#account").val();
	var account_type=$("[name='account_type']").val();
	$.getJSON("<{:U('User/doWithdraw')}>",{tel:tel,money:money,account:account,account_type:account_type,code:code},function(data){
		if(data.error==0){
		 	// window.location.href="/User/withdraw_list";
				 dialog("提现申请提交成功",function(){hiApp.jump("/User/withdraw_list")},500);
			  
		}else{
			 dialog(data.msg);
		}
			$(_this).attr("onclick","post(this)");
 		$(_this).attr("text","提现");
	})

}
</script>
 